

*********************************************************************************************
********* ANALYSES:   F O R E I G N   P O L I C Y    A N A L Y S I S  ***********************
********************* F I N A L      V E R S I O N   ****************************************
*********************************************************************************************


*****************************************************************************
************************* F I G U R E S ***********************************
*****************************************************************************

*********************************************
**** 1st SET OF EXPERIMENTS *****************
*********************************************
** variables:

*Regime Change
reg experimento2VD i.experimento2VI
*reg br_derro i.br_lid_derro1
gen br_derro = experimento2VD 
gen br_lid_derro1 = experimento2VI

* Regional Conflict
reg experimento4VD i.experimento4VI
*reg br_confli i.br_lid_confli1
gen br_confli = experimento4VD
gen br_lid_confli1 = experimento4VI

*Economic Integration
reg experimento3VD i.experimento3VI
*reg br_treat i.br_lid_treat1
gen br_treat = experimento3VD
gen br_lid_treat1 = experimento3VI
 

 
*********************************************
**** 2nd SET OF EXPERIMENTS *****************
********************************************* 
 ** recreating variables
gen derro=.
replace derro=1 if Q_178==5
replace derro=1 if Q_179==5
replace derro=1 if Q_180==5
replace derro=1 if Q_181==5
replace derro=1 if Q_182==5
replace derro=1 if Q_183==5
replace derro=1 if Q_184==5
replace derro=1 if Q_185==5

replace derro=2 if Q_178==4
replace derro=2 if Q_179==4
replace derro=2 if Q_180==4
replace derro=2 if Q_181==4
replace derro=2 if Q_182==4
replace derro=2 if Q_183==4
replace derro=2 if Q_184==4
replace derro=2 if Q_185==4

replace derro=3 if Q_178==3
replace derro=3 if Q_179==3
replace derro=3 if Q_180==3
replace derro=3 if Q_181==3
replace derro=3 if Q_182==3
replace derro=3 if Q_183==3
replace derro=3 if Q_184==3
replace derro=3 if Q_185==3

replace derro=4 if Q_178==2
replace derro=4 if Q_179==2
replace derro=4 if Q_180==2
replace derro=4 if Q_181==2
replace derro=4 if Q_182==2
replace derro=4 if Q_183==2
replace derro=4 if Q_184==2
replace derro=4 if Q_185==2

replace derro=5 if Q_178==1
replace derro=5 if Q_179==1
replace derro=5 if Q_180==1
replace derro=5 if Q_181==1
replace derro=5 if Q_182==1
replace derro=5 if Q_183==1
replace derro=5 if Q_184==1
replace derro=5 if Q_185==1


label var derro "En caso que un presidente sea derrocado, Brasil debe..."
label values derro acuerdo5

**** 2.- Conflicto militar entre dos paises
gen confli=.
replace confli=1 if Q_188==5
replace confli=1 if Q_189==5
replace confli=1 if Q_190==5
replace confli=1 if Q_191==5
replace confli=1 if Q_192==5
replace confli=1 if Q_193==5
replace confli=1 if Q_194==5
replace confli=1 if Q_195==5

replace confli=2 if Q_188==4
replace confli=2 if Q_189==4
replace confli=2 if Q_190==4
replace confli=2 if Q_191==4
replace confli=2 if Q_192==4
replace confli=2 if Q_193==4
replace confli=2 if Q_194==4
replace confli=2 if Q_195==4

replace confli=3 if Q_188==3
replace confli=3 if Q_189==3
replace confli=3 if Q_190==3
replace confli=3 if Q_191==3
replace confli=3 if Q_192==3
replace confli=3 if Q_193==3
replace confli=3 if Q_194==3
replace confli=3 if Q_195==3

replace confli=4 if Q_188==2
replace confli=4 if Q_189==2
replace confli=4 if Q_190==2
replace confli=4 if Q_191==2
replace confli=4 if Q_192==2
replace confli=4 if Q_193==2
replace confli=4 if Q_194==2
replace confli=4 if Q_195==2

replace confli=5 if Q_188==1
replace confli=5 if Q_189==1
replace confli=5 if Q_190==1
replace confli=5 if Q_191==1
replace confli=5 if Q_192==1
replace confli=5 if Q_193==1
replace confli=5 if Q_194==1
replace confli=5 if Q_195==1

label var confli "En caso de conflicto militar entre dos paises, Brasil debe..."
label values confli acuerdo5


*** Experiment COMBINADO Regime Change
recode Q_177 (.=.), gen (lid_pais)
label var lid_pais "EXP: Tipo Liderazgo y Pais"
label define lid_pais 1 "Vene_Sancion Economica" 2 "Uru_Sancion Economica" 3 "Vene_Org Internacional" ///
	4 "Uru_Org Internacional" 5 "Vene_Romper relaciones" 6 "Uru_Romper relaciones" 7 "Vene_No accion" 8 "Uru_No accion"
label values lid_pais lid_pais

*** Experiment COMBINADO Regional Conflic
recode Q_187 (.=.), gen (lid_region)
label var lid_region "EXP: Tipo Liderazgo y REGION"
label define lid_region 1 "ChiArg_Sancion Economica" 2 "VeneCol_Sancion Economica" 3 "ChiArg_Org Internacional" ///
	4 "VeneCol_Org Internacional" 5 "ChiArg_Romper relaciones" 6 "VeneCol_Romper relaciones" 7 "ChiArg_No accion" 8 "VeneCol_No accion"
label values lid_region lid_region


///// FIGURE 4. Brazilian Citizens� Support for Foreign Policy Action of Leadership (SFPAL) 
////             in Case of Regime Change, 
////             2nd Set of Experiments 


*** Scenario 1: Regime Change
*tab derro
*bysort lid_pais: tab derro
*tab derro lid_pais, row col chi2

*** Modelo: Linear Regression
reg derro i.lid_pais
estimate store derro1, title (Regime Change)
eststo derro_1: margins lid_pais, post 

*** Figure Scenario 4. Regime Change
coefplot derro_1, drop(_cons) ciopts(recast(rcap)) mlabel format(%9.2g) mlabposition(12)mlabgap(*2) /// 
	ytitle(" ")  ///
	xtitle("Marginal Predicted Effect of""Experimental Treatments on SFPAL") ///
	horizontal title("Scenario 4. Regime Change") ///
	graphregion(fcolor(white)) 	///
	coeflabel(1.lid_pais = "Venezuela" 2.lid_pais = "Uruguay" 3.lid_pais = "Venezuela" 4.lid_pais = "Uruguay" ///
	5.lid_pais = "Venezuela" 6.lid_pais = "Uruguay" 7.lid_pais = "Venezuela" 8.lid_pais = "Uruguay" ) ///
	heading(1.lid_pais="{bf:Treatment 1. Economic Sanctions}" 3.lid_pais="{bf:Treatment 2. Multilateral Condemnation}" ///
	5.lid_pais="{bf:Tretment 3. Unilateral Diplomatic Break}" 7.lid_pais="{bf:Control. No Action}" ) ///
	note("N = 1,695. Adj. R2 =  0.0677", span) 
graph save derro_1.gph, replace


///// FIGURE 5. Brazilian Citizens� Support for Foreign Policy Action of Leadership (SFPAL) 
////             in Case of Regional Conflict, 
////             2nd Set of Experiments 


*** Scenario 2: Military Conflict (Hay un resultado que no me est� dando)
*tab confli
*bysort lid_region: tab confli
*tab confli lid_region, row col chi2

*** Modelo: Linear Regression
reg confli i.lid_region
estimate store confli1, title (Militaty Conflict)
eststo confli_1: margins lid_region, post 


*** Figure Scenario 5. Regional Conflict
coefplot confli_1, drop(_cons) ciopts(recast(rcap)) mlabel format(%9.2g) mlabposition(12)mlabgap(*2) /// 
	ytitle("")  ///
	xtitle("Marginal Predicted Effects of""Experimental Treatments on SFPAL") ///
	horizontal title("Scenario 5. Regional Conflict") ///
	graphregion(fcolor(white)) 	///
	coeflabel(1.lid_region = "Argentina vs Chile" 2.lid_region = "Venezuela vs. Colombia" 3.lid_region = "Argentina vs Chile" 4.lid_region = "Venezuela vs Colombia" ///
	5.lid_region = "Argentina vs Chile" 6.lid_region = "Venezuela vs Colombia" 7.lid_region = "Argentina vs Chile" 8.lid_region = "Venezuela vs Colombia" ) ///
	heading(1.lid_region="{bf:Treatment 1. Economic Sanctions}" 3.lid_region="{bf:Treatment 2. Multilateral Condemnation}" ///
	5.lid_region="{bf:Tretment 3. Unilateral Diplomatic Break}" 7.lid_region="{bf:Control. No Action}" ) ///
	note("N = 1,705. Adj. R2 = 0.0548", span) 
graph save confli_1.gph, replace



///// APPENDIX ///////////
///// FIGURE A1. Brazilian Citizens� Support for Foreign Policy Action of Leadership (SFPAL)
//// 1st Set of Experiments ////

*** FIRST: It is necessary to run again the regression analysis for each one of the Experiments
*** so, we can obtain the Predicted Probabilities

///// Experiment ONE: 3  Escenarios and 3 types of Leadership

*** Scenario 1: Regime Change
tab br_derro
bysort br_lid_derro1: tab br_derro
tab br_derro br_lid_derro1, row col chi2

ologit br_derro i.br_lid_derro1
estimate store br_derro1, title (Regime Change)
eststo br_derro_1: margins br_lid_derro1, predict (outcome(5)) post 
marginsplot, recast(scatter) horizontal title("Brasil" "Liderazgo ante derrocamiento") ///
	ytitle("Pr(Acuerdo liderazgo)") xtitle("Prob. marginales predichas")



*** Scenario 2: Regional Conflict
tab br_confli
bysort br_lid_confli1: tab br_confli
tab br_confli br_lid_confli1, row col chi2

ologit br_confli i.br_lid_confli1
estimate store br_confli1, title (Regional Conflict)
eststo br_confli_1: margins br_lid_confli1, predict (outcome(5)) post 
marginsplot, recast(scatter) horizontal title("Brasil" "Liderazgo ante conflicto territorial") ///
	ytitle("Pr(Acuerdo liderazgo)") xtitle("Prob. marginales predichas")



*** Scenario 3: Economic Integration
tab br_treat
bysort br_lid_treat1: tab br_treat

ologit br_treat i.br_lid_treat1
estimate store br_treat1, title (Economic Integration)
eststo br_treat_1: margins br_lid_treat1, predict (outcome(5)) post 
marginsplot, recast(scatter) horizontal title("Brasil" "Liderazgo ante Integracion economica") ///
	ytitle("Pr(Acuerdo liderazgo)") xtitle("Prob. marginales predichas")


*** Combined Figure with results from Brazil of Three Escenarios: Regime Change, Regional Conflict and Economic Integration

*** Figure: Scenario 1. Regime Change 
coefplot br_derro_1, drop(_cons) ciopts(recast(rcap)) mlabel format(%9.2g) mlabposition(12)mlabgap(*2) /// 
	ytitle(" ")  ///
	xtitle(" ") ///
	horizontal title("Scenario 1. Regime Change") ///
	graphregion(fcolor(white)) 	///
	coeflabel(1.br_lid_derro1 = "Treatment 1: Economic Sanctions" 2.br_lid_derro1 = "Treatment 2: Multilateral Condemnation" ///
	0.br_lid_derro1 = "Control: No Action") ///
	note("N = 1,764. Pseudo R2 = 0.0092", span) 
graph save br_derro_1.gph, replace


*** Figure: Scenario 2. Regional Conflict
coefplot br_confli_1, drop(_cons) ciopts(recast(rcap)) mlabel format(%9.2g) mlabposition(12)mlabgap(*2) /// 
	ytitle(" ")  ///
	xtitle(" ") ///
	horizontal title("Scenario 2. Regional Conflict") ///
	graphregion(fcolor(white)) 	///
	coeflabel(1.br_lid_confli1 = "Treatment 1: Economic Sanctions" 2.br_lid_confli1 = "Treatment 2: Multilateral Condemnation" ///
	0.br_lid_confli1 = "Control: No Action") ///
	note("N = 1,735. Pseudo R2 = 0.0121", span) 
graph save br_confli_1.gph, replace

*** Figure: Scenario 3. Economic Integration
coefplot br_treat_1, drop(_cons) ciopts(recast(rcap)) mlabel format(%9.2g) mlabposition(12)mlabgap(*2) /// 
	ytitle("")  ///
	xtitle("Marginal Predicted Probabilities of""Being 'Totally Agree' with SFPAL") ///
	horizontal title("Scenario 3. Economic Integration") ///
	graphregion(fcolor(white)) 	///
	coeflabel(1.br_lid_treat1 = "Treatment 1: Economic Sanctions" 2.br_lid_treat1 = "Treatment 2: Multilateral Condemnation" ///
	0.br_lid_treat1 = "Control: No Action") ///
	note("N = 1,703. Pseudo R2 =  0.0238", span)
graph save br_treat_1.gph, replace


*** FIGURE A1 *********************************
*** Combined Figure of Three Scenarios: Ordered Logit
graph combine br_derro_1.gph br_confli_1.gph br_treat_1.gph , ///
	graphregion(fcolor(white)) ycommon xcommon cols(1)  
	
	
********************************
///// FIGURE A2 and A3. Brazilian CitizensҠSupport for Foreign Policy Action of Leadership (SFPAL)
//// 1st Set of Experiments ////

///// Experiment TWO: 2  Escenarios and 4 types of Leadership AND 2 Countries / Regions

*** Scenario 1: Regime Change
tab derro
bysort lid_pais: tab derro
tab derro lid_pais, row col chi2

*** Modelo: Ordered Logit
ologit derro i.lid_pais
estimate store derro1, title (Regime Change)
eststo derro_1: margins lid_pais, predict (outcome(5)) post 
marginsplot, recast(scatter) horizontal title("Brasil" "Liderazgo ante derrocamiento") ///
	ytitle("Pr(Acuerdo liderazgo)") xtitle("Prob. marginales predichas")


*** Scenario 2: Military Conflict (Hay un resultado que no me estᡤando)
tab confli
bysort lid_region: tab confli
tab confli lid_region, row col chi2

*** Modelo: Ordered Logit
ologit confli i.lid_region
estimate store confli1, title (Militaty Conflict)
eststo confli_1: margins lid_region, predict (outcome(5)) post 
marginsplot, recast(scatter) horizontal title("Brasil" "Liderazgo ante conflicto militar") ///
	ytitle("Pr(Acuerdo liderazgo)") xtitle("Prob. marginales predichas")

	
*** FIGURE A2 
*** Figure Scenario 4. Regime Change
coefplot derro_1, drop(_cons) ciopts(recast(rcap)) mlabel format(%9.2g) mlabposition(12)mlabgap(*2) /// 
	ytitle(" ")  ///
	xtitle("Marginal Predicted Probabilities of""Being 'Totally Agree' with SFPAL") ///
	horizontal title("Scenario 4. Regime Change") ///
	graphregion(fcolor(white)) 	///
	coeflabel(1.lid_pais = "Venezuela" 2.lid_pais = "Uruguay" 3.lid_pais = "Venezuela" 4.lid_pais = "Uruguay" ///
	5.lid_pais = "Venezuela" 6.lid_pais = "Uruguay" 7.lid_pais = "Venezuela" 8.lid_pais = "Uruguay" ) ///
	heading(1.lid_pais="{bf:Treatment 1. Economic Sanctions}" 3.lid_pais="{bf:Treatment 2. Multilateral Condemnation}" ///
	5.lid_pais="{bf:Tretment 3. Unilateral Diplomatic Break}" 7.lid_pais="{bf:Control. No Action}" ) ///
	note("N = 1,695. Pseudo R2 =  0.0272", span) 
graph save derro_1.gph, replace

*** FIGURE A3
*** Figure Scenario 5. Regional Conflict
coefplot confli_1, drop(_cons) ciopts(recast(rcap)) mlabel format(%9.2g) mlabposition(12)mlabgap(*2) /// 
	ytitle("")  ///
	xtitle("Marginal Predicted Probabilities of""Being 'Totally Agree' with SFPAL") ///
	horizontal title("Scenario 5. Regional Conflict") ///
	graphregion(fcolor(white)) 	///
	coeflabel(1.lid_region = "Argentina vs Chile" 2.lid_region = "Venezuela vs. Colombia" 3.lid_region = "Argentina vs Chile" 4.lid_region = "Venezuela vs Colombia" ///
	5.lid_region = "Argentina vs Chile" 6.lid_region = "Venezuela vs Colombia" 7.lid_region = "Argentina vs Chile" 8.lid_region = "Venezuela vs Colombia" ) ///
	heading(1.lid_region="{bf:Treatment 1. Economic Sanctions}" 3.lid_region="{bf:Treatment 2. Multilateral Condemnation}" ///
	5.lid_region="{bf:Tretment 3. Unilateral Diplomatic Break}" 7.lid_region="{bf:Control. No Action}" ) ///
	note("N = 1,705. Pseudo R2 = 0.0202", span) 
graph save confli_1.gph, replace




** AFTER DOFILES
do "C:\Users\sony\Google Drive\Opiniao Publica RI\Experimentos Survey\Feliciano\FPA - Dados revisao\FPA Feliciano et al _ Contamination Effects.do"
